From 9ae348c07ce058dfc125a7036bb662a76d93e64f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20H=C3=A4rdeman?= Date: Mon, 24 Nov 2025 00:32:22 +0100 Subject: [PATCH] dhcpv6: remove OAF_TENTATIVE MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The flag was only set in two places, and never used. Its meaning was also essentially the inverse of OAF_BOUND. Signed-off-by: David Härdeman Link: https://github.com/openwrt/odhcpd/pull/331 Signed-off-by: Álvaro Fernández Rojas --- src/dhcpv6-ia.c | 6 +----- src/odhcpd.h | 7 +++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index 1b17cf7..6f3852d 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -1226,12 +1226,9 @@ proceed: ia_response_len = build_ia(buf, buflen, status, ia, a, iface, hdr->msg_type == DHCPV6_MSG_REBIND ? false : true); - /* Was only a solicitation: mark binding for removal */ + /* Was only a solicitation: mark binding for removal in 60 seconds */ if (assigned && hdr->msg_type == DHCPV6_MSG_SOLICIT && !rapid_commit) { a->flags &= ~OAF_BOUND; - a->flags |= OAF_TENTATIVE; - - /* Keep tentative assignment around for 60 seconds */ a->valid_until = now + 60; } else if (assigned && @@ -1248,7 +1245,6 @@ proceed: } } a->accept_fr_nonce = accept_reconf; - a->flags &= ~OAF_TENTATIVE; a->flags |= OAF_BOUND; apply_lease(a, true); } else if (!assigned) { diff --git a/src/odhcpd.h b/src/odhcpd.h index d7a32bb..3fb3acc 100644 --- a/src/odhcpd.h +++ b/src/odhcpd.h @@ -190,10 +190,9 @@ enum odhcpd_mode { enum odhcpd_assignment_flags { - OAF_TENTATIVE = (1 << 0), - OAF_BOUND = (1 << 1), - OAF_DHCPV6_NA = (1 << 2), - OAF_DHCPV6_PD = (1 << 3), + OAF_BOUND = (1 << 0), + OAF_DHCPV6_NA = (1 << 1), + OAF_DHCPV6_PD = (1 << 2), }; /* 2-byte type + 128-byte DUID, RFC8415, §11.1 */ -- 2.30.2